package util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;

//import java.util.HashSet;
//import java.util.Iterator;

public class Clean {

	public static void main(String[] args) throws IOException {
		BufferedReader in;
		PrintStream out;
		in = new BufferedReader(new InputStreamReader(System.in));
		out = System.out;

		while (true) {
			out.println("Please input: (type quit to exit)");
			String output = new String();
			String input = in.readLine().trim();
			if (input.equalsIgnoreCase("quit"))
				break;

			String[] stringArray = input.split(" ");

			for (int i = 0; i < stringArray.length; i++) {
				if (stringArray[i].equals("1"))
					output = output + i + " ";
			}

			// HashSet<String> set = new HashSet<String>();
			// for (int i = 0; i < stringArray.length; i++) {
			// set.add(stringArray[i]);
			// }
			//
			// Iterator<String> iterator = set.iterator();
			//
			// while (iterator.hasNext()) {
			// output = output.concat(iterator.next()).concat(" ");
			// }
			out.println(output);
			// out.println("Total: " + set.size());
		}
	}
}
